home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / prolog / modprolg / mod-prol.lha / Prolog / modlib / src / $prorc.P < prev    next >
Text File  |  1992-06-01  |  11KB  |  268 lines

  1. /************************************************************************
  2. *                                    *
  3. * The SB-Prolog System                            *
  4. * Copyright SUNY at Stony Brook, 1986; University of Arizona, 1987    *
  5. *                                    *
  6. ************************************************************************/
  7.  
  8. /*-----------------------------------------------------------------
  9. SB-Prolog is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY.  No author or distributor
  11. accepts responsibility to anyone for the consequences of using it
  12. or for whether it serves any particular purpose or works at all,
  13. unless he says so in writing.  Refer to the SB-Prolog General Public
  14. License for full details.
  15.  
  16. Everyone is granted permission to copy, modify and redistribute
  17. SB-Prolog, but only under the conditions described in the
  18. SB-Prolog General Public License.   A copy of this license is
  19. supposed to have been given to you along with SB-Prolog so you
  20. can know your rights and responsibilities.  It should be in a
  21. file named COPYING.  Among other things, the copyright notice
  22. and this notice must be preserved on all copies. 
  23. ------------------------------------------------------------------ */
  24.  
  25. /****************************************************************************
  26.  *                                                                          *
  27.  * This file has been changed by to include Modules Extensions              *
  28.  * Changes by : Brian Paxton 1991/92                                        *
  29.  * Last update : June 1992                                                  *
  30.  *                                                                          *
  31.  * Organisation : University of Edinburgh.                                  *
  32.  * For : Departments of Computer Science and Artificial Intelligence        * 
  33.  *       Fourth Year Project.                                               *
  34.  *                                                                          *
  35.  ****************************************************************************/
  36.  
  37. /* $prorc.P */
  38.  
  39. /* This file is called when $readloop is initializing the system.
  40.    It gives the user a chance to set up the defined_mods/2 predicate
  41.    so that the standard system (or some other) predicates will be
  42.    automatically loaded on need. 
  43.    Use $define_mod(Modname,Implist) to specify default loading of Modname
  44.    when a predicate in Implist is invoked. Implist must correspond to
  45.    the export list of Modname.
  46. */
  47.  
  48. $prorc :- $prorc_bio,$prorc_io,$prorc_assert,$prorc_bmeta,$prorc_meta,
  49.     $prorc_name,$prorc_read,$prorc_inlines,$prorc_osys,$prorc_glob,
  50.     $prorc_compare,$prorc_deb,$prorc_retr,$prorc_consult,$prorc_buff,
  51.     $prorc_defint,$prorc_setof,$prorc_db,$prorc_compile,$prorc_mod,
  52.     $prorc_prag,$prorc_blist,$prorc_listutil1,$prorc_mac, 
  53.     $prorc_arith, $prorc_prof, $prorc_stat, $prorc_dcg, $prorc_portray,
  54.     $prorc_decompile, $prorc_record, $prorc_currsyms, $prorc_opcode,
  55.     $prorc_funrel, $prorc_modules.
  56.  
  57. $prorc_bio :-
  58.     $define_mod($bio,[writename/1,writeqname/1,put/1,nl/0,tab/1,
  59.         tell/1,tell/2,telling/1,told/0,get/1,get0/1,see/1,seeing/1,
  60.         seen/0,_]),
  61.     $define_mod($bio,[$writename/1,$writeqname/1,$put/1,$nl/0,$tab/1,
  62.         $tell/1,$tell/2,$telling/1,$told/0,$get/1,$get0/1,$see/1,
  63.         $seeing/1,$seen/0,$write4/1]).
  64.  
  65. $prorc_io :-
  66.     $define_mod($io,[write/1,writeq/1,display/1,print/1,print_al/2,
  67.             print_ar/2,errmsg/1]),
  68.     $define_mod($io,[$write/1,$writeq/1,$display/1,$print/1,
  69.             $print_al/2,$print_ar/2,$errmsg/1]).
  70.  
  71. $prorc_assert :-
  72.     $define_mod($assert,[assert/1,asserta/1,asserta/2,assertz/1,assertz/2,
  73.         assert/2,asserti/2,assert/4,assert_union/2,_,_,_,_,
  74.         assert/3,asserta/3,assertz/3,asserti/3]),
  75.     $define_mod($assert,[$assert/1,$asserta/1,$asserta/2,$assertz/1,
  76.                 $assertz/2,$assert/2,$asserti/2,$assert/4,$assert_union/2,
  77.         $assert_call_s/1,$assert_get_prref/2,$assert_put_prref/2,
  78.         $assert_abolish_i/1,$assert/3,$asserta/3,$assertz/3,
  79.         $asserti/3]).
  80.  
  81. $prorc_bmeta :-
  82.     $define_mod($bmeta,[atom/1,atomic/1,integer/1,number/1,
  83.        compound_term/1,_,_,arg/3,arity/2,real/1,
  84.        float/1, _,is_buffer/1,bldstr/4,_,_,function/1,predicate/1]),
  85.     $define_mod($bmeta,[$atom/1,$atomic/1,$integer/1,$number/1,
  86.        $structure/1,$functor0/2,$bldstr/3,$arg/3,$arity/2,$real/1,
  87.        $float/1,$mkstr/3, $is_buffer/1,$bldstr/4,$functor0/2,
  88.        $functor0/3,$function/1,$predicate/1]).
  89.  
  90. $prorc_meta :-
  91.     $define_mod($meta,[_,_,length/2,'=..'/3,compound/4]),
  92.     $define_mod($meta,[$functor/3,$univ/2,$length/2,$univ/3,
  93.                        $functor/4]).
  94.  
  95. $prorc_name :-
  96.     $define_mod($name,[_,_,name/3]),
  97.     $define_mod($name,[$name/2,$name0/2,$name/3]).
  98.  
  99. $prorc_read :-
  100.     $define_mod($read,[_,read/2,_,read/3]),
  101.     $define_mod($read,[$read/1,$read/2,$read_module/1,$read/3]).
  102.  
  103. $prorc_inlines :-
  104.     $define_mod($inlines,['='/2,'<'/2,'=<'/2,'>='/2,'>'/2,'=:='/2,
  105.     '=\='/2,is/2,eval/2,'_$savecp'/1,'_$cutto'/1,var/1,nonvar/1,
  106.     fail/0,true/0,halt/0,'?='/2,'\='/2]).
  107.  
  108. $prorc_osys :-
  109.     $define_mod($osys,[cputime/1,syscall/3,_,system/1]),
  110.     $define_mod($osys,[$cputime/1,$syscall/3,$system/2,$system/1]).
  111.  
  112. $prorc_glob :-
  113.     $define_mod($glob,[globalset/1,gennum/1,gensym/2]),
  114.     $define_mod($glob,[$globalset/1,$gennum/1,$gensym/2]).
  115.  
  116. $prorc_compare :-
  117.     $define_mod($compare,['=='/2,'\=='/2,'@=<'/2,'@<'/2,'@>'/2,'@>='/2,
  118.         compare/3]),
  119.     $define_mod($compare,['$=='/2,_,_,_,_,_,$compare/3]).
  120.  
  121. $prorc_deb :-
  122.     $define_mod($deb,[debug/0,nodebug/0,trace/1,untrace/1,
  123.         (spy)/1,(nospy)/1,trace/0,untrace/0,debugging/0,
  124.         tracepreds/1,spypreds/1]),
  125.     $define_mod($deb,[$debug/0,$nodebug/0,$trace/1,$untrace/1,
  126.         ($spy)/1,($nospy)/1,$trace/0,$untrace/0,$debugging/0,
  127.         $deb_tracepreds/1,$deb_spypreds/1]).
  128.  
  129. $prorc_retr :-
  130.     $define_mod($retr,[retract/1,abolish/1,abolish/2,_,
  131.         retractall/1,retract/2,retractall/2]),
  132.     $define_mod($retr,[$retract/1,$abolish/1,$abolish/2,$update/2,
  133.             $retractall/1,$retract/2,$retractall/2]).
  134.  
  135. $prorc_oldconsult :-
  136.     $define_mod($oldconsult,[$oldconsult/1,$oldconsult/2,$oldconsult/3,
  137.                     $oldconsult_list/1]).
  138.  
  139. $prorc_consult :-
  140.     $define_mod($consult,[consult/1,consult/2,consult/3,_]),
  141.     $define_mod($consult,[$consult/1,$consult/2,$consult/3,
  142.                               $consult_list/1]).
  143.  
  144. $prorc_buff :-
  145.     $define_mod($buff,[alloc_perm/2,alloc_heap/2,trimbuff/3,
  146.             _,symtype/2,substring/6,subnumber/6,
  147.         subdelim/6,conlength/2,
  148.         pred_undefined/1,hashval/3]),
  149.     $define_mod($buff,[$alloc_perm/2,$alloc_heap/2,$trimbuff/3,
  150.         $buff_code/4,$symtype/2,$substring/6,$subnumber/6,
  151.         $subdelim/6,$conlength/2,
  152.         $pred_undefined/1,$hashval/3]).
  153.  
  154. $prorc_defint :-
  155.     $define_mod($defint,[defint_call/4]),
  156.     $define_mod($defint,[$defint_call/4]).
  157.  
  158. $prorc_setof :-
  159.     $define_mod($setof,[setof/3,bagof/3,findall/3,sort/2,keysort/2,'^'/2]),
  160.     $define_mod($setof,[$setof/3,$bagof/3,$findall/3,$sort/2,
  161.                 $keysort/2,_]).
  162.  
  163. $prorc_db :-
  164.     $define_mod($db,[$db_new_prref/1,$db_assert_fact/5,
  165.         $db_assert_fact/7, $db_add_clref/5,
  166.         $db_call_prref/2,$db_call_prref_s/2,$db_call_prref_s/3,
  167.         $db_call_clref/2,$db_get_clauses/3,$db_kill_clause/1]).
  168.  
  169. $prorc_compile :-
  170.     $define_mod($compile,[compile/0,compile/1,compile/2,compile/3,
  171.         compile/4]),
  172.     $define_mod($compile,[$compile/0,$compile/1,$compile/2,$compile/3,
  173.         $compile/4]).
  174.  
  175. $prorc_mod :-
  176.     $define_mod($getclauses,[getclauses/2,getclauses/3,attach/2,
  177.                 expand_term/2]),
  178.     $define_mod($getclauses,[$getclauses/2,$getclauses/3,$attach/2,
  179.                 $expand_term/2]).
  180.  
  181. $prorc_prag :-
  182.     $define_mod($prag,[get_prag/2]),
  183.     $define_mod($prag,[$get_prag/2]).
  184.  
  185. $prorc_blist :-
  186.     $define_mod($blist,[$append/3,$member/2,$memberchk/2,
  187.                 $not_memberchk/2]),
  188.     $define_mod($blist,[append/3,member/2,$member1/2,$not_member1/2]).
  189.  
  190. $prorc_listutil1 :-
  191.     $define_mod($listutil1,[reverse/2,merge/3,absmember/2,absmerge/3,
  192.         nthmember/3,_,_,closetail/1]),
  193.     $define_mod($listutil1,[$reverse/2,$merge/3,$absmember/2,$absmerge/3,
  194.         $nthmember/3,$nthmember1/3,$member2/2,$closetail/1]).
  195.  
  196. $prorc_mac :-
  197.     $define_mod($mac,[$macexp/3]).
  198.  
  199. $prorc_arith :-
  200.     $define_mod($arith,[$floatc/3,$exp/2,$square/2,$sin/2,$floor/2]),
  201.     $define_mod($arith,[floatc/3,exp/2,square/2,sin/2,floor/2]).
  202.  
  203. $prorc_prof :-
  204.     $define_mod($prof, [$count/1,$time/1,$nocount/1,$notime/1,
  205.         $profiling/0,$prof_reset/1, $prof_resetcount/1,
  206.         $prof_resettime/1,$profile/0,$noprofile/0,$timepreds/1,
  207.         $countpreds/1, $prof_stats/0, $prof_stats/1]),
  208.     $define_mod($prof, [count/1,time/1,nocount/1,notime/1,
  209.         profiling/0,prof_reset/1,resetcount/1,
  210.         resettime/1,profile/0,noprofile/0,timepreds/1,
  211.         countpreds/1,prof_stats/0, prof_stats/1]).
  212.  
  213. $prorc_stat :-
  214.     $define_mod($statistics,[$statistics/0,$statistics/2]),
  215.     $define_mod($statistics,[statistics/0,statistics/2]).
  216.  
  217. $prorc_dcg :-
  218.     $define_mod($dcg, [$dcg/2,$phrase/2,$phrase/3,'C'/3]),
  219.     $define_mod($dcg, [dcg/2,phrase/2,phrase/3,_]).
  220.  
  221. $prorc_portray :-
  222.     $define_mod($portray,[$portray_term/1,$portray_clause/1]),
  223.     $define_mod($portray,[portray_term/1,portray_clause/1]).
  224.  
  225. $prorc_decompile :-
  226.     $define_mod($decompile,[$clause/2,$clause/3,$listing/1,$instance/2,
  227.             $oldlisting/0,$listing/0,$list_module/1]),
  228.     $define_mod($decompile,[clause/2,clause/3,listing/1,instance/2,
  229.             _,listing/0,list_module/1]).
  230.  
  231. $prorc_record :-
  232.     $define_mod($record,[erase/1,recorda/3,recordz/3,recorded/3]),
  233.     $define_mod($record,[$erase/1,$recorda/3,$recordz/3,$recorded/3]).
  234.  
  235. $prorc_currsyms :-
  236.         $define_mod($currsym,[current_predicate/2,_,predicate_property/2,_,_,_,
  237.             current_atom/1,_,pervasive/1,pervasive0/1,
  238.             pervasive_function/1,pervasive_function0/1,
  239.             pervasive_predicate/1,pervasive_predicate0/1,
  240.             functor_name/1,structure_name/1,signature_name/1,
  241.             current_function/2,_]),
  242.         $define_mod($currsym,[$current_predicate/2,$current_predicate/3,
  243.                 $predicate_property/2,$predicate_property/3,
  244.             $current_functor/2,$current_functor/3,$current_atom/1,
  245.             $current_atom/2,$pervasive/1,$pervasive0/1,
  246.             $pervasive_function/1,$pervasive_function0/1,
  247.             $pervasive_predicate/1,$pervasive_predicate0/1,
  248.             $functor_name/1,$structure_name/1,$signature_name/1,
  249.             $current_function/2,$current_function/3]).
  250.  
  251. $prorc_opcode :- $define_mod($opcode,[$opcode/2,$opcode/3,$instruction/2]).
  252.  
  253. $prorc_funrel :- $define_mod($funrel,[$fun_rel/2,$expand_body/2,$fun_rel/3,
  254.                 $expand_body/3]).
  255.  
  256. $prorc_modules :- 
  257.     $define_mod($modules,[$setup_modules/0,$dismantle_name/3,
  258.         $check_destination/2,$move_clause/4,
  259.         $isa_structuretag/1,$current_structure/2,
  260.         $structure/3,$structure/4,$check_not_function/1]),
  261.     $define_mod($modules,[_,dismantle_name/3,_,_,_,
  262.         current_structure/2,(structure)/3,(structure)/4,_]).
  263.  
  264.  
  265. % Others modules :
  266. %
  267. % $call $readloop $dbcmpl
  268.